<?php
/**
 * 描述：资讯-公共。
 * @abstract
 */
abstract class Exec_News_Public extends Exec
{
    public function Get()
    {
        #获取数据-关键字
        $data=DB::GetRows('select * from news_keywords order by Datetime asc');
        View::Assign('Keywords',$data);

        #获取数据-最新资讯
        View::Assign('News_Latest',DAO_News::Latest());

        #获取数据-访谈
        $data=DB::GetRows('select * from interview order by ID desc limit 0,3');
        @$data[0]['ThumbnailPath']=Config::PATH_RELATIVE_ATTACHMENT_TEMP.'/'.@$data[0]['ThumbnailPath'];
        View::Assign('Interview_Topside',@$data[0]);
        View::Assign('Interview',array_slice($data,1,count($data)));

        #获取数据-专题
        $data=DB::GetRows('select * from topic order by ID desc limit 0,1');
        foreach($data as &$row)
        {
            $row['ThumbnailPath']=Config::PATH_RELATIVE_ATTACHMENT_TOPIC.'/'.$row['ThumbnailPath'];
        }
        View::Assign('Topic',$data);

        #获取数据-观察
        $data=DB::GetRows('select * from news where M_IsDelete=FALSE and SubclassID='.DAO_NewsClass::OBSERVE_COMMENT_ID.' and Thumbnail is not NULL and Thumbnail<>"" order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        foreach($data as &$row)
        {
            $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
        }
        View::Assign('NewsClass_ObserveComment_ID',DAO_NewsClass::OBSERVE_COMMENT_ID);
        View::Assign('Observe',$data);
    }
}
?>